package com.pdg.dungeondelver.client;

import java.awt.*;

import javax.swing.*;

public class MainWindow extends JFrame{
	private static final long serialVersionUID = 770244559988871887L;
	
	private MapPanel mapPanel = null;
	private void createMapPanel(){
		mapPanel = new MapPanel(this);
		GridBagConstraints c = new GridBagConstraints();
		c.gridx=0;
		c.gridy=0;
		c.gridheight=480;
		c.gridwidth=480;
		getContentPane().add(mapPanel,c);
	}
	public MapPanel getMapPanel(){
		if(mapPanel==null){
			createMapPanel();
		}
		return mapPanel;
	}
	
	public MainWindow(){
		super(Constants.MAIN_WINDOW_TITLE);
	}
	protected void frameInit() {
		super.frameInit();
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		getContentPane().setLayout(new GridBagLayout());
		setSize(Constants.MAIN_WINDOW_WIDTH,Constants.MAIN_WINDOW_HEIGHT);
		setVisible(true);
		setResizable(false);
		getMapPanel();
	}
}
